﻿using MCPlatform.Models;
using MCPlatform.Models.Motions;
using MCPlatform.MotionLib.Base;
using MCPlatform.Shared.Enums;
using MCPlatform.UI.Controls.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;

namespace MCPlatform.Builder.WorkStation
{
    public interface IStation
    {
        public string StationName { get; set; }

        public string StationKey { get; set; }

        public LogModel LogModel { get; set; }

        public CancellationTokenSource CancellationTokenSource { get; set; }

        public ManualResetEvent PauseEventSource { get; set; }

        public ManualResetEvent SingleStepCompleteEvent { get; set; }

        public bool IsClear { get; set; }
        public bool IsReady { get; set; }            

        public bool IsDone { get; set; }

        public bool IsShield { get; set; }
       

        public WorkStationModel WorkStationModel { get; set; }

        public ObservableCollection<CylinderModel> CylinderModels { get; set; }

        public ObservableCollection<AxisModel> AxisModels { get; set; }

        public ObservableCollection<IOModel> IOModels { get; set; }

        public ObservableCollection<PointSettingModel> PointSettingModels { get; set; }

        public ObservableCollection<RobotModel> RobotModels { get; set; }

        public  Task Initial();

        public Task DryRun();


        public Task Execute();

        public Task Pause();

        public Task Resume();

        public Task Stop(string? stopMessage = null, bool isSetAbortedStatus = true);

      

        public Task Clear(bool isClear);
        public Task Test();
        public  Task<(bool, short, string)> Reset();

        public void NextStep();
        public void RegisterEvent();

        public event Func<string, MessageBoxResult>? RetryEvent;

        public (bool, string, string) ResumnBeforeCheckStatus();

    }
}
